package com.ruoyi.zsyh.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.IdWorker;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.zsyh.mapper.ZsyhPlatformPartsTypeDetailMapper;
import com.ruoyi.zsyh.domain.ZsyhPlatformPartsTypeDetail;
import com.ruoyi.zsyh.service.IZsyhPlatformPartsTypeDetailService;
import com.ruoyi.common.core.text.Convert;

/**
 * 产品分类Service业务层处理
 * 
 * @author yuexl
 * @date 2022-03-17
 */
@Service
public class ZsyhPlatformPartsTypeDetailServiceImpl implements IZsyhPlatformPartsTypeDetailService 
{
    @Autowired
    private ZsyhPlatformPartsTypeDetailMapper zsyhPlatformPartsTypeDetailMapper;

    /**
     * 查询产品分类
     * 
     * @param id 产品分类ID
     * @return 产品分类
     */
    @Override
    public ZsyhPlatformPartsTypeDetail selectZsyhPlatformPartsTypeDetailById(String id)
    {
        return zsyhPlatformPartsTypeDetailMapper.selectZsyhPlatformPartsTypeDetailById(id);
    }

    /**
     * 查询产品分类列表
     * 
     * @param zsyhPlatformPartsTypeDetail 产品分类
     * @return 产品分类
     */
    @Override
    public List<ZsyhPlatformPartsTypeDetail> selectZsyhPlatformPartsTypeDetailList(ZsyhPlatformPartsTypeDetail zsyhPlatformPartsTypeDetail)
    {
        return zsyhPlatformPartsTypeDetailMapper.selectZsyhPlatformPartsTypeDetailList(zsyhPlatformPartsTypeDetail);
    }

    @Override
    public List<ZsyhPlatformPartsTypeDetail> selectZsyhPlatformPartsTypeDetailSecondList(ZsyhPlatformPartsTypeDetail zsyhPlatformPartsTypeDetail) {
        return zsyhPlatformPartsTypeDetailMapper.selectZsyhPlatformPartsTypeDetailSecondList(zsyhPlatformPartsTypeDetail);
    }

    /**
     * 新增产品分类
     * 
     * @param zsyhPlatformPartsTypeDetail 产品分类
     * @return 结果
     */
    @Override
    public int insertZsyhPlatformPartsTypeDetail(ZsyhPlatformPartsTypeDetail zsyhPlatformPartsTypeDetail)
    {
        zsyhPlatformPartsTypeDetail.setId(IdWorker.getId());
        zsyhPlatformPartsTypeDetail.setCreateTime(DateUtils.getNowDate());
        return zsyhPlatformPartsTypeDetailMapper.insertZsyhPlatformPartsTypeDetail(zsyhPlatformPartsTypeDetail);
    }

    /**
     * 修改产品分类
     * 
     * @param zsyhPlatformPartsTypeDetail 产品分类
     * @return 结果
     */
    @Override
    public int updateZsyhPlatformPartsTypeDetail(ZsyhPlatformPartsTypeDetail zsyhPlatformPartsTypeDetail)
    {
        zsyhPlatformPartsTypeDetail.setUpdateTime(DateUtils.getNowDate());
        return zsyhPlatformPartsTypeDetailMapper.updateZsyhPlatformPartsTypeDetail(zsyhPlatformPartsTypeDetail);
    }

    /**
     * 删除产品分类对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteZsyhPlatformPartsTypeDetailByIds(String ids)
    {
        return zsyhPlatformPartsTypeDetailMapper.deleteZsyhPlatformPartsTypeDetailByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除产品分类信息
     * 
     * @param id 产品分类ID
     * @return 结果
     */
    @Override
    public int deleteZsyhPlatformPartsTypeDetailById(String id)
    {
        return zsyhPlatformPartsTypeDetailMapper.deleteZsyhPlatformPartsTypeDetailById(id);
    }
}
